package com.bwda.dsrs.filecenter.api;


import com.bwda.dsrs.filecenter.domain.exception.BusinessServiceException;
import com.bwda.dsrs.filecenter.api.log.LogTemplate;
import com.bwda.dsrs.filecenter.config.FeginInterceptor;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.scheduling.annotation.Async;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 日志服务调用API
 *
 * @author yanyuemei
 * @date 2019 /4/26
 */
@FeignClient(name = "logservice", fallback = LogServiceApiFallback.class, configuration = FeginInterceptor.class)
public interface LogServiceApi {

    /**
     * 日志处理缓存模式
     *
     * @param logTemplate log template
     * @return
     * @throws BusinessServiceException business service exception
     */
    @PostMapping(value = "/handleLogForCache")
    @Async
    public void handleLogForCache(LogTemplate logTemplate) throws BusinessServiceException;


    /**
     * Test hello string
     *
     * @param id id
     * @return the string
     */
    @PostMapping(value = "/testHello")
    @Async
    public String testHello(@RequestParam(value = "id") Integer id);

}
